<template>
	<view class="pageBg">
		<leader @goodsDetails="goodsDetails" :title="i.name" @mode="mode(i.id)" v-for="(i, index) in list" :listData="i.course"></leader>
	</view>
</template>

<script>
export default {
	data() {
		return {
			list: []
		};
	},
	onLoad() {
		this.init();
	},
	methods: {
		async init() {
			const res = await this.$api.CourseIndex();
			this.list = res.data;
		},
		mode(id) {
			uni.navigateTo({
				url: '/pages/index/future/list/list?id=' + id
			});
		},
		goodsDetails({ item, index }) {
			uni.navigateTo({
				url: '/pages/index/future/detail/detail?id=' + item.id
			});
		}
	}
};
</script>

<style lang="scss" scoped></style>
